<template>
  <div class="shareltem">
    <!-- 这里的v-html 就是选人富文本 让搜索的文本关键字变红色 -->
    <h3 class="title van-ellipsis" v-html="info.title" @click="golnfo"></h3>
    <div class="content van-multi-ellipsis--l2" @click="golnfo">
      {{ info.content }}
    </div>

    <div class="message">
      <img
        v-if="info.author.avatar"
        :src="$baseUrl + info.author.avatar"
        alt=""
        class="o1"
      />
      <img v-else src="@/assets/logo.png" alt="" class="o1" />
      <div class="o2">{{ info.author.nickname }}</div>
      <div class="o3">{{ info.updated_at | formatTime }}</div>
      <i class="o4 iconfont">&#xe65b;</i>
      <div class="o5">{{ info.read }}</div>
      <i class="o6 iconfont">&#xe638;</i>
      <div class="o7">{{ info.star }}</div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['info'],
  methods: {
    golnfo () {
      // 点击跳转到详情页
      this.$router.push(
        '/home/sharelnfo/' + this.info.id + '?path=' + this.$route.fullPath
      )
    }
  }
}
</script>

<style lang="less" scoped>
.shareltem {
  margin-bottom: 15px;
  margin-top: 34px;
  padding: 0 @p15;
  .title {
    font-size: 16px;
    font-family: PingFangSC, PingFangSC-Medium;
    font-weight: 700;
    text-align: left;
    color: #181a39;
    line-height: 22px;
    letter-spacing: 0px;
    padding-bottom: 11px;
  }
  .content {
    font-size: 13px;
    font-family: PingFangSC, PingFangSC-Regular;
    font-weight: 400;
    text-align: left;
    color: #545671;
    line-height: 18px;
    letter-spacing: 0px;
  }
  .message {
    display: flex;
    align-items: center;
    padding-top: 13px;
    .o1 {
      width: 22px;
      height: 22px;
      border-radius: 50%;
    }
    .o2 {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #545671;
      line-height: 16px;
      letter-spacing: 0px;
      flex: 1;
      padding-left: 10px;
    }
    .o3 {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #b4b4bd;
      line-height: 16px;
      letter-spacing: 0px;
    }
    .o4 {
      padding-left: 21px;
      padding-right: 7px;
      color: #b4b4bd;
    }
    .o5 {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #b4b4bd;
      line-height: 16px;
      letter-spacing: 0px;
      padding-right: 23px;
    }
    .o6 {
      color: #b4b4bd;
      padding-right: 10px;
    }
    .o7 {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: left;
      color: #b4b4bd;
      line-height: 16px;
      letter-spacing: 0px;
    }
  }
}
</style>
